//
//  ConditionTableViewCell.m
//  CwinCar
//
//  Created by dlios on 15/10/26.
//  Copyright © 2015年 dlios. All rights reserved.
//

#import "ConditionTableViewCell.h"

@implementation ConditionTableViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(20*suitableScreen_Width, 5, mainScreen_Width-suitableScreen_Width*40, suitableScreen_Height*30)];
        self.priceLabel = [[UILabel alloc]initWithFrame:CGRectMake(20*suitableScreen_Width, suitableScreen_Height*35, mainScreen_Width/3, suitableScreen_Height*30)];
        
        self.engineLabel = [[UILabel alloc]initWithFrame:CGRectMake(mainScreen_Width/3+40*suitableScreen_Width, suitableScreen_Height*35, mainScreen_Width/3, suitableScreen_Height*30)];
        
        self.transLabel = [[UILabel alloc]initWithFrame:CGRectMake(20*suitableScreen_Width, suitableScreen_Height*65, mainScreen_Width-suitableScreen_Width*40, suitableScreen_Height*30)];
        
        [self.contentView addSubview:self.nameLabel];
        [self.contentView addSubview:self.priceLabel];
        [self.contentView addSubview:self.engineLabel];
        [self.contentView addSubview:self.transLabel];
    }
    return self;
}
-(void)cellForModel:(DetailConditionModel *)model
{
    self.nameLabel.text = [model.carName stringByAppendingFormat:@"(%@)",model.typeyear];
    self.priceLabel.text = model.carPrice;
    self.priceLabel.textColor = [UIColor orangeColor];
    self.engineLabel.text = model.engine;
    self.transLabel.text = model.transmission;
    
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
